<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
if($_RQ['op']=='list'){
	$group_id=intval($_RQ['group_id']);
	$params=array('uniacid'=>$_SESSION['uniacid']);
	$groups=pdo_getall('jy_help_group',$params);
	$return['url']=custom_url('jy_weishop/welcome.home/',true);	
	if($groups){
		foreach($groups as &$item){
			$item['url']=custom_url('jy_weishop/news.list//group_id='.$item['id'],true);
			$item['image'] = $item['image'] ? tomedia($item['image']) : '../core/resource/images/nopic.jpg';
		}
	}
	$params=array('uniacid'=>$_SESSION['uniacid']);
	$groupinfo=pdo_get('jy_help_group',array('id'=>$group_id,'uniacid'=>$_SESSION['uniacid']));
	$sharelink='jy_help/list//fromuser='.$_SESSION['uid'].'&group_id='.$group_id;
	$return['sharedata']=array(
			'title'=>$groupinfo['title']?:'问题分类',
			'desc'=>$groupinfo['desc']?:'问题分类',
			'link'=>custom_url($sharelink,true)
	);
	$return['groups']=$groups?$groups:array();
	$return['list']=$list?$list:array();
	$return['params']['group_id'] =$group_id;
	set_html('title',$groupinfo['title']?:'问题分类');
	exi($return);
}